package com.slj.service.impl;

import com.slj.entity.ProductTypes;
import com.slj.mapper.ProductTypesMapper;
import com.slj.service.ProductTypesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductTypesServiceImpl implements ProductTypesService {

    @Autowired
    private ProductTypesMapper productTypesMapper;

    // 根据主键删除商品类型
    @Override
    public int deleteByPrimaryKey(Integer typeId) {
        return productTypesMapper.deleteByPrimaryKey(typeId);
    }

    // 插入商品类型记录
    @Override
    public int insert(ProductTypes record) {
        return productTypesMapper.insert(record);
    }

    // 选择性插入商品类型记录
    @Override
    public int insertSelective(ProductTypes record) {
        return productTypesMapper.insertSelective(record);
    }

    // 根据主键查询商品类型
    @Override
    public ProductTypes selectByPrimaryKey(Integer typeId) {
        return productTypesMapper.selectByPrimaryKey(typeId);
    }

    // 选择性更新商品类型
    @Override
    public int updateByPrimaryKeySelective(ProductTypes record) {
        return productTypesMapper.updateByPrimaryKeySelective(record);
    }

    // 更新商品类型所有字段
    @Override
    public int updateByPrimaryKey(ProductTypes record) {
        return productTypesMapper.updateByPrimaryKey(record);
    }

    // 查询所有商品类型
    @Override
    public List<ProductTypes> selectAll() {
        return productTypesMapper.selectAll();
    }
}